package daily.nov;

public class lc2169 {
    /*
    非常简单。但是要注意while中的条件判断。若使用||，num1=0，num2！=0，即false or true =true。无限循环。应使用&&符号
     */
    public int countOperations(int num1, int num2) {
        int count = 0;
        while(num1!=0 && num2!=0) {
            if (num1>=num2){
                num1=num1-num2;
            }else {
                num2=num2-num1;
            }
            count++;
        }

        return count;
    }

    public static void main(String[] args) {
        lc2169 lc2169 = new lc2169();
        System.out.println(lc2169.countOperations(2,3));
        System.out.println(lc2169.countOperations(10,10));

    }
}
